#include<bits/stdc++.h>
#define int long long
using namespace std;

map<int, vector<int>>mp;
int ret = 0;
int p = 0;

void js(int x) {
	if(x < 10) {
		ret = max(ret, p);
		return ;
	}
	int t = 1;
	while(x) {
		t = t * (x % 10);
		x /= 10;
	}
	p ++ ;
	js(t);
}

signed main() {
	int a, b;
	cin >> a >> b;
//	js(679);
//	cout << "ret = " << ret << endl;
	for(int i = a; i <= b; ++ i ) {
		p = 0;
		js(i);
		mp[p].push_back(i);
	}
	cout << ret << endl;
	vector<int>t = mp[ret];
	for(int i = 0; i < t.size(); ++ i ) {
		if(i == 0)cout << t[i];
		else cout << ' ' << t[i];
	}
	return 0;
}

